package com.cloud.logger.zchain.spring.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Author: wcy
 * @Description:
 * @Date: Created in 2017/12/15 16:38
 * @Modified By:
 */
@Data
@ConfigurationProperties("zchain")
public class ZchainProperties {

    private String baseUrl = "http://localhost:2001/";

    private ZchainProperties.Project project = new ZchainProperties.Project();

    private ZchainProperties.Code code = new ZchainProperties.Code();

    private ZchainProperties.Zookeeper zookeeper = new ZchainProperties.Zookeeper();

    public ZchainProperties() {
    }

    public static class Project {
        private String scenic = "zchain_scenic";
        private String name = "zchain_project";

        public Project() {
        }

        public String getScenic() {
            return scenic;
        }

        public void setScenic(String scenic) {
            this.scenic = scenic;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static class Code {
        private String name = "errCode";
        private String success = "8200,8300,200";
        private String error = "8500,500";

        public Code() {
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSuccess() {
            return success;
        }

        public void setSuccess(String success) {
            this.success = success;
        }

        public String getError() {
            return error;
        }

        public void setError(String error) {
            this.error = error;
        }
    }

    public static class Zookeeper {
        private String host = "127.0.0.1:2181";
        private String nameSpace = "zchain-client";
        private Integer connectionTimeOut = 5000;

        public Zookeeper() {
        }

        public String getHost() {
            return host;
        }

        public void setHost(String host) {
            this.host = host;
        }

        public String getNameSpace() {
            return nameSpace;
        }

        public void setNameSpace(String nameSpace) {
            this.nameSpace = nameSpace;
        }

        public Integer getConnectionTimeOut() {
            return connectionTimeOut;
        }

        public void setConnectionTimeOut(Integer connectionTimeOut) {
            this.connectionTimeOut = connectionTimeOut;
        }
    }
}
